package br.com.acme;

import java.util.ArrayList;

/**
 * @author Calebe Arruda
 * @author Roberto Sanmartin
 * @version 1.01
 */
public class Article extends Publication{
    
    private long issn;
    private byte issue;
    private short startPage;
    private short endPage;
    private ArrayList<String> keyWords;
    private Journal journal;
    
    public Article(){
       keyWords = new ArrayList<>();
    }

    /**
     * @return the issn
     */
    public long getIssn() {
        return issn;
    }

    /**
     * @param issn the issn to set
     */
    public void setIssn(long issn) {
        this.issn = issn;
    }

    /**
     * @return the issue
     */
    public byte getIssue() {
        return issue;
    }

    /**
     * @param issue the issue to set
     */
    public void setIssue(byte issue) {
        this.issue = issue;
    }

    /**
     * @return the startPage
     */
    public short getStartPage() {
        return startPage;
    }

    /**
     * @param startPage the startPage to set
     */
    public void setStartPage(short startPage) {
        this.startPage = startPage;
    }

    /**
     * @return the endPage
     */
    public short getEndPage() {
        return endPage;
    }

    /**
     * @param endPage the endPage to set
     */
    public void setEndPage(short endPage) {
        this.endPage = endPage;
    }

    /**
     * @return the journal
     */
    public Journal getJournal() {
        return journal;
    }

    /**
     * @param journal the journal to set
     */
    public void setJournal(Journal journal) {
        this.journal = journal;
    }
    
    /**
     * Function to add a key in Article
     * @param key to be added
     */
    public void addKeyWord(String key){
        keyWords.add(key);
    }
    
    /**
     * Function that returns the keys in Article
     * @return a list of keys
     */
    public ArrayList<String> getKeyWords(){
        return keyWords;
    }
    
    /**
     * Function to remove a key
     * @param key to be removed
     * @return true for yes, false for no
     */
    public boolean removeKeyWord(String key){
        if(keyWords.contains(key)){
            keyWords.remove(key);
            return true;
        }
        return false;
    }
    
}
